package com.ojoin.trade.bpm.web.domain;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ojoin.trade.common.web.domain.DataEntity;

/**
 * Bpm Entity类
 */
public abstract class BpmEntity<T> extends DataEntity<T> implements Serializable {

	private static final long serialVersionUID = 1L;

	protected Bpm bpm; 		// 流程任务对象

	public BpmEntity() {
		super();
	}
	
	public BpmEntity(int id) {
		super(id);
	}
	
	@JsonIgnore
	public Bpm getBpm() {
		if (bpm == null){
			bpm = new Bpm();
		}
		return bpm;
	}

	public void setBpm(Bpm bpm) {
		this.bpm = bpm;
	}

	/**
	 * 获取流程实例ID
	 * @return
	 */
	public String getProcInsId() {
		return this.getBpm().getProcInsId();
	}

	/**
	 * 设置流程实例ID
	 * @param procInsId
	 */
	public void setProcInsId(String procInsId) {
		this.getBpm().setProcInsId(procInsId);
	}
}
